package com.hp.goods_details_service.feign;

import com.hp.common_api.entity.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient("goods-service")
public interface GoodsFeignClient {

    /**
     * 通过品牌id查品牌
     * @param id
     * @return
     */
    @GetMapping("brand/{id}")
    public ResponseEntity<Brand> getBrandById(@PathVariable Long id);

    /**
     * 通过类型id查询类型
     * @param cid
     * @return
     */
    @GetMapping("category/{cid}")
    ResponseEntity<Category> getCategoryById(@PathVariable Long cid);

    /**
     * 通过SpuID查询下面所有的SKU
     * @return
     */
    @GetMapping("/skus/spu/{spuId}")
    ResponseEntity<List<Sku>> getSkusBySpuId(@PathVariable Long spuId);

    /**
     * 通过SpuID查询下面所有的SKU
     * @return
     */
    @GetMapping("/spuDetail/{spuId}")
    ResponseEntity<SpuDetail> getSpuDetailBySpuId(@PathVariable Long spuId);

    /**
     * 通过分类id查询所有下面的规格
     * @param cid
     * @return
     */
    @GetMapping("/specParams/category/{cid}")
    ResponseEntity<List<SpecParam>> getSpecParamsByCategoryId(@PathVariable Long cid);

    /**
     * 通过id查询spu
     * @param spuId
     * @return
     */
    @GetMapping("/spu/{spuId}")
    ResponseEntity<Spu> getSpuById(@PathVariable Long spuId);

    /**
     * 通过类型id查询规格分组
     * @param cid
     * @return
     */
    @GetMapping("/specGroups/category/{cid}")
    ResponseEntity<List<SpecGroup>> getSpecGroupsByCategoryId(@PathVariable Long cid);
}
